/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.xuexiang.xui_lib.component.dialog.view;

import ohos.app.Context;

import com.xuexiang.xui_lib.component.dialog.config.ChooseBean;
import com.xuexiang.xui_lib.component.dialog.config.ConfigBean;
import com.xuexiang.xui_lib.component.dialog.interfaces.CheckBoxItemDialogListener;
import com.xuexiang.xui_lib.component.dialog.interfaces.DialogListener;
import com.xuexiang.xui_lib.component.dialog.interfaces.ItemDialogListener;

import java.util.ArrayList;

/**
 * description styledialog
 *
 * @author liuluming
 * @since 2021-04-08
 */
public class StyledDialog {

    /**
     * buildMdAlert
     *
     * @param context context
     * @param title 对话框的title
     * @param msg 对话框的提示信息
     * @param listener 对话框 ok 和 cancle 的点击监听事件
     * @return configbean
     */
    public static ConfigBean buildMdAlert(Context context, CharSequence title, CharSequence msg,
                                          DialogListener listener) {
        return DialogAssigner.getInstance().assignMdAlert(context, title, msg, listener);
    }

    /**
     * buildTipAlert
     *
     * @param context context
     * @param title 对话框的title
     * @param msg 对话框的提示信息
     * @param submit
     * @param cancel
     * @param listener 对话框 ok 和 cancle 的点击监听事件,可以修改文字
     * @return configbean
     */
    public static ConfigBean buildTipAlert(Context context, CharSequence title, CharSequence msg, String submit, String cancel,
                                           DialogListener listener) {
        return DialogAssigner.getInstance().assignTipAlert(context, title, msg, submit, cancel, listener);
    }

    public static ConfigBean buildTipImageAlert(Context context, CharSequence title, CharSequence msg, String submit, String cancel,
                                                DialogListener listener) {
        return DialogAssigner.getInstance().assignTipImageAlert(context, title, msg, submit, cancel, listener);
    }

    /**
     * buildMdIOSAlert
     *
     * @param context context
     * @param title 对话框的title
     * @param msg 对话框的提示信息
     * @param listener 对话框 ok 和 cancle 的点击监听事件
     * @return configbean
     */
    public static ConfigBean buildMdIOSAlert(Context context, CharSequence title, CharSequence msg,
                                             DialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSAlert(context, title, msg, listener);
    }

    /**
     * buildMdIOSAlertVertical
     *
     * @param context context
     * @param title 对话框的title
     * @param msg 对话框的提示信息
     * @param listener 对话框 ok 和 cancle 的点击监听事件
     * @return configbean
     */
    public static ConfigBean buildMdIOSAlertVertical(Context context, CharSequence title, CharSequence msg,
                                                     DialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSAlertVertical(context, title, msg, listener);
    }

    /**
     * buildMdSingleChoose
     *
     * @param context context
     * @param title 对话框的title
     * @param list list
     * @param listener 单项的item 和ok cancle 的点击事件的监听
     * @return configbean
     */
    public static ConfigBean buildMdSingleChoose(Context context, CharSequence title, ArrayList<ChooseBean> list,
                                                 ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdSingleChoose(context, title, list, listener);
    }

    public static ConfigBean buildMySingleChoose(Context context, CharSequence title, String submit, String cancel, ArrayList<ChooseBean> list,
                                                 ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMySingleChoose(context, title, submit, cancel, list, listener);
    }

    public static ConfigBean buildMdSingleMenuChoose(Context context, ArrayList<ChooseBean> list,
                                                     int x, int y, int menuWidth, int menuHeight, ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSSingleMenuChoose(context, list, x, y, menuWidth, menuHeight, listener);
    }


    /**
     * buildMdIOSSingleChoose
     *
     * @param context context
     * @param list list
     * @param listener 单项的item 和ok cancle 的点击事件的监听
     * @return configbean
     */
    public static ConfigBean buildMdIOSSingleChoose(Context context, ArrayList<ChooseBean> list,
                                                    ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSSingleChoose(context, list, listener);
    }

    /**
     * buildMdIOSList
     *
     * @param context context
     * @param list list
     * @param listener list  item 的点击事件
     * @return return
     */
    public static ConfigBean buildMdIOSList(Context context, ArrayList<ChooseBean> list,
                                            ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSList(context, list, listener);
    }

    public static ConfigBean buildMdIMAGEList(Context context, ArrayList<ChooseBean> list,
                                              ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIMAGEList(context, list, listener);
    }

    public static ConfigBean buildMdIOSListOther(Context context, ArrayList<ChooseBean> list,
                                                 ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSListOther(context, list, listener);
    }

    /**
     * buildMdIOSBottomSingleChoose
     *
     * @param context context
     * @param list list
     * @param listener 单项的item 和ok cancle 的点击事件的监听
     * @return configbean
     */
    public static ConfigBean buildMdIOSBottomSingleChoose(Context context, ArrayList<ChooseBean> list,
                                                          ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSBottomSingleChoose(context, list, listener);
    }

    public static ConfigBean builtIosSingleMenuChoose(Context context, ArrayList<ChooseBean> list, int x, int y, int menuWidth,
                                                      int menuHeight, ItemDialogListener listener) {
        return DialogAssigner.getInstance().assignMdIOSSingleMenuChoose(context, list, x, y, menuWidth, menuHeight, listener);
    }

    /**
     * buildMdMultiChoose
     *
     * @param context context
     * @param title 对话框的title
     * @param list list
     * @param btnListener ok cancle 的点击监听事件
     * @return configbean
     */
    public static ConfigBean buildMdMultiChoose(Context context, CharSequence title, ArrayList<ChooseBean> list,
                                                CheckBoxItemDialogListener btnListener) {
        return DialogAssigner.getInstance().assignMdMultiChoose(context, title, list, btnListener);
    }

    /**
     * buildNormalInput
     *
     * @param context context
     * @param title 对话框的title
     * @param hint1 输入框的hint 文字提示信息
     * @param listener ok cancle 的点击监听事件
     * @return configbean
     */
    public static ConfigBean buildNormalInput(Context context, CharSequence title, CharSequence hint1,
                                              DialogListener listener) {
        return DialogAssigner.getInstance().assignNormalInput(context, title, hint1, listener);
    }

    public static ConfigBean buildCountInput(Context context, CharSequence title, CharSequence hint1,
                                             DialogListener listener) {
        return DialogAssigner.getInstance().assignCountInput(context, title, hint1, listener);
    }

    /**
     * buildTwoInput
     *
     * @param context context
     * @param title 对话框title
     * @param hint1 第一个输入框的提示信息
     * @param hint2 第二个输入框的提示信息
     * @param listener ok cancle 的点击监听事件
     * @return ConfigBean
     */
    public static ConfigBean buildTwoInput(Context context, CharSequence title, CharSequence hint1, CharSequence hint2,
                                           DialogListener listener) {
        return DialogAssigner.getInstance().assignTwoInput(context, title, hint1, hint2, listener);
    }


}
